package itcz.example.pattern.behavior_type.command;

/**
 * @ClassName: Client
 * @Author: ITCZ
 * @Date: 2025-07-23
 * @Description:
 */
public class Client {
    public static void main(String[] args) {
        // 创建订单对象
        //创建2个order
        Order order1 = new Order();
        order1.setDiningTable(1);
        order1.getFoodDic().put("西红柿鸡蛋面",1);
        order1.getFoodDic().put("小杯可乐",2);

        Order order2 = new Order();
        order2.setDiningTable(3);
        order2.getFoodDic().put("尖椒肉丝盖饭",1);
        order2.getFoodDic().put("小杯雪碧",1);
        // 创建厨师(实现者/接收者)对象
        SeniorChef receiver = new SeniorChef();
        // 创建命令对象
        Command command1 = new OrderCommand(receiver,order1);
        Command command2 = new OrderCommand(receiver,order2);
        // 创建美女服务员(调用者)对象
        Waitor waitor = new Waitor();
        waitor.setCommand(command1);
        waitor.setCommand(command2);
        // 命令发起
        waitor.orderUp();
    }
}
